﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XWord.Fundamental.Domain;
using System.IO;
using Iesi.Collections.Generic;
using NHibernateUnitOfWork;

namespace ConsoleApplication1
{
    public class TranslateTest
    {
        public static void Test1()
        {
            TextReader reader = new StreamReader("D:\\test.txt", Encoding.Default);

            DateTime time=new DateTime(2008,6,22);

            for (int i = 0; i < 4; i++)
            {

                time=time.AddMonths(-6);
                for (int j = 0; j < 5; j++)
                {
                    Translate trans = new Translate();
                    
                    string choiceStr = reader.ReadLine().Trim();
                    if (!string.IsNullOrEmpty(choiceStr))
                    {
                        choiceStr = choiceStr.Substring(choiceStr.IndexOf(".") + 1).Trim();
                        trans.Sentence = choiceStr;
                        trans.Priority = j;
                        trans.CreateTime = time;
                        UnitOfWork.CurrentSession.Save(trans);
                        UnitOfWork.CurrentSession.Flush();
                    }
                }
               
                // list.Add(qustion);
            }
            //  art.Questions.Clear();
            
        }
    }
}
